Skip to content

feat: swap in Overlay Menu block to replace template parts#438

Open
laurelfulford wants to merge 2 commits intotrunkfrom
feat/add-overlay-block
Open

feat: swap in Overlay Menu block to replace template parts#438
laurelfulford wants to merge 2 commits intotrunkfrom
feat/add-overlay-block

Conversation

@laurelfulford
Copy link
Copy Markdown
Contributor

@laurelfulford laurelfulford commented Apr 7, 2026

All Submissions:

Changes proposed in this Pull Request:

This PR removes the mobile menu and drawer template parts, and replaces them with the Overlay Menu block.

It should be tested along with Automattic/newspack-plugin#4642, which fixes a bug in the Overlay Menu Block that only seems to crop up when you're switching between template parts.

Closes NPPD-1397

How to test the changes in this Pull Request:

  1. Apply the PR and run npm run build.
  2. Navigate to Site Editor > Patterns > Header, and make sure the theme-bundled header template parts - Header, Header (Mobile), and Header (Desktop) are all reset to the theme's defaults.
  3. Edit the Header (Desktop) template part.
  4. With the template part selected, in the right sidebar click the Template Part tab, and test the different non-default layouts 2-4. For each:
  5. Repeat the same steps with the Header (Mobile) pattern, and check the default part plus 2-6.
  6. For template parts 5-6 for the mobile header, make sure the panel opens from the right.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the theme’s custom mobile/drawer menu template parts and JS/CSS menu system with the Newspack Overlay Menu block, updating header patterns accordingly.

Changes:

  • Remove legacy mobile/drawer menu JS modules and drawer SCSS, and stop importing them from the front-end entry points.
  • Replace mobile-menu / drawer-menu pattern usage in header patterns with newspack/overlay-menu blocks.
  • Delete now-unused menu pattern/template-part files and update internal documentation notes.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/scss/style.scss Stops importing drawer overlay styles.
src/scss/overlays/_drawer.scss Removes legacy drawer toggle styling.
src/js/front-end/main.js Removes legacy menu initializers from the front-end bundle.
src/js/front-end/menus/mobile.js Deletes legacy mobile menu initializer.
src/js/front-end/menus/drawer.js Deletes legacy drawer menu initializer.
patterns/header/header-mobile-style-1.php Replaces mobile-menu template-part with Overlay Menu block.
patterns/header/header-mobile-style-2.php Replaces mobile-menu template-part with Overlay Menu block.
patterns/header/header-mobile-style-3.php Replaces mobile-menu template-part with Overlay Menu block.
patterns/header/header-mobile-style-4.php Replaces mobile-menu template-part with Overlay Menu block.
patterns/header/header-mobile-style-5.php Replaces mobile-menu template-part with Overlay Menu block (right slide).
patterns/header/header-mobile-style-6.php Replaces mobile-menu template-part with Overlay Menu block (right slide).
patterns/header/header-desktop-style-2.php Replaces drawer menu pattern with Overlay Menu block.
patterns/header/header-desktop-style-3.php Replaces drawer menu pattern with Overlay Menu block.
patterns/header/header-desktop-style-4.php Replaces drawer menu pattern with Overlay Menu block.
patterns/drawer-menu.php Deletes legacy drawer menu pattern.
parts/mobile-menu.html Deletes legacy mobile menu template part.
parts/mobile-contents.html Deletes legacy mobile menu contents template part.
parts/drawer-contents.html Deletes legacy drawer contents template part.
AGENTS.md Removes documentation describing the legacy dual menu systems.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@laurelfulford laurelfulford marked this pull request as ready for review April 7, 2026 23:33
@laurelfulford laurelfulford requested a review from a team as a code owner April 7, 2026 23:33
@laurelfulford laurelfulford changed the title feat: swap in Overlay Menu block to replace templtae parts feat: swap in Overlay Menu block to replace template parts Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants